-
Notifications
You must be signed in to change notification settings - Fork 593
HDDS-6194. EC: Freon ockg support EC write #2996
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HDDS-6194. EC: Freon ockg support EC write #2996
Conversation
sodonnel
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be nice to keep the old option as @Deprecated for backward compatibility. It should imply --type RATIS, and be mutually exclusive with --replication.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
STANDALONE --> STAND_ALONE ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
parse is returning default values even if we pass replication and type as null.
When we set the EC on bucket, ideally it's not mandatory to pass the type and replication with key as we moved the default configs to server side along with bucket.
Please refer the JIRA: HDDS-6184
|
Thanks @sodonnel @adoroszlai @umamaheswararao for the review, while #2990 merged I will update this PR. |
|
HI @captainzmc, JFYI The pr #2990 is committed now. You may want to resume your work. Thanks |
04ca2ce to
58a9c54
Compare
|
Hi @adoroszlai @sodonnel @umamaheswararao, since @captainzmc is on vacation, I have updated the code according to your comments above. Please take another look, thanks. |
adoroszlai
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @kaijchen for updating the patch.
| ReplicationType.RATIS, factor, metadata)) { | ||
| replicationConfig, metadata)) { | ||
| contentGenerator.write(stream); | ||
| stream.flush(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got this for EC key:
$ ozone freon ockg -n1 -t1 --replication 'rs-3-2-1024k' --type EC
...
NotImplementedException: The flush API is not implemented yet.
at org.apache.hadoop.ozone.client.io.ECKeyOutputStream.flush(ECKeyOutputStream.java:468)
at org.apache.hadoop.ozone.client.io.OzoneOutputStream.flush(OzoneOutputStream.java:55)
at org.apache.hadoop.ozone.freon.OzoneClientKeyGenerator.lambda$createKey$0(OzoneClientKeyGenerator.java:145)
at com.codahale.metrics.Timer.time(Timer.java:101)
at org.apache.hadoop.ozone.freon.OzoneClientKeyGenerator.createKey(OzoneClientKeyGenerator.java:141)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this is expected. It should be fixed in another PR.
ozone/hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/io/ECKeyOutputStream.java
Lines 466 to 469 in 22e3482
| @Override | |
| public void flush() { | |
| throw new NotImplementedException("The flush API is not implemented yet."); | |
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we catch this exception here in ockg?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably for now if Type is EC, ignore to invoke flush? [ We thought not to implement flush unless there is a critical req for it. ]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably for now if Type is EC, ignore to invoke flush? [ We thought not to implement flush unless there is a critical req for it. ]
Maybe just catch this exception? Since it's already in a try clause.
And if flush is implemented in the future, it will work without any change.
| if (spec.commandLine().getParseResult().hasMatchedOption("--factor")) { | ||
| replicationConfig = ReplicationConfig | ||
| .fromTypeAndFactor(ReplicationType.RATIS, factor); | ||
| } else { | ||
| replicationConfig = OzoneClientUtils | ||
| .validateAndGetClientReplicationConfig(replicationType, replication, | ||
| ozoneConfiguration); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Something is wrong around option handling. Setting only replication, but neither factor nor type, a regular RATIS/3 key was created:
$ ozone freon ockg -n1 -t1 --replication 'rs-3-2-1024k' -p replication_rs-3-2-1024k
...
Successful executions: 1
$ ozone sh key info /vol1/bucket1/replication_rs-3-2-1024k/0
...
"replicationConfig" : {
"replicationFactor" : "THREE",
"requiredNodes" : 3,
"replicationType" : "RATIS"
},
...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is meaningless to set replication or type only.
And it's also possible to set --type EC with --replication THREE together.
| type/replication | THREE | rs-3-2-1024k |
|---|---|---|
| RATIS | OK | Bad |
| EC | Bad | OK |
Should we bind this two options together like RATIS/THREE or EC/rs-3-2-1024k instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Something is wrong around option handling. Setting only
replication, but neitherfactornortype, a regular RATIS/3 key was created:
This is due to OzoneClientUtils#validateAndGetClientReplicationConfig, the default client config was used.
ozone/hadoop-ozone/ozonefs-common/src/main/java/org/apache/hadoop/fs/ozone/OzoneClientUtils.java
Lines 172 to 175 in c4aec7b
| if (userPassedType == null && clientConfiguredDefaultType != null) { | |
| clientReplicationType = | |
| ReplicationType.valueOf(clientConfiguredDefaultType); | |
| } |
|
Yes, that should be fine. |
aab08ef to
ac6aa13
Compare
umamaheswararao
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
@adoroszlai do you any more comments? Otherwise I will just go ahead to merge. |
adoroszlai
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @kaijchen for updating the patch. Works fine in valid combinations. I think we can add validations later.
|
Thanks @umamaheswararao and @adoroszlai for reviewing. |
What changes were proposed in this pull request?
see: https://issues.apache.org/jira/browse/HDDS-6194
How was this patch tested?
NA.